import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/main'
  },
  {
    path: '/main',
    name: '首页',
    component: () => import('../views/Home.vue'),
    children:[
      {
        path: 'session',
        name: '会话',
        component: () => import('@/components/mainChild/Session.vue'),
      },
      {
        path: 'history',
        name: '历史',
        component: () => import('@/components/mainChild/Index.vue'),
      },
      {
        path: 'index',
        name: '首页',
        component: () => import('@/components/mainChild/Index.vue'),
      },
      {
        path: 'visitor',
        name: '访客',
        component: () => import('@/components/mainChild/Visitor.vue'),
      },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
